package com.iword.simple.event.demo;

import java.util.List;
import java.util.Map;

import com.iword.simple.event.handler.annotation.Event;
import com.iword.simple.event.queue.EventPriority;
import com.iword.simple.event.handler.annotation.EventHandler;

@EventHandler("/test")
public class DemoEventHandler {

    @Event("aa")
    public void aa(ParamDto paramDto) {
        System.out.println("接收到事件aa: " + paramDto.toString());
        // do something
    }

    @Event(value = "bb", priority = EventPriority.MIDDLE)
    public void bb(List<ParamDto> params) {
        System.out.println("接收到事件bb: " + params.size());
        params.forEach(System.out::println);
        // do something
    }

    @Event(value = "cc", priority = EventPriority.LOW)
    public void cc(Map params) {
        System.out.println("接收到事件cc: " + params);
    }
}